﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Checkers.Sever.DBModule.databaseProxy
{
    public interface IDatabaseUtility
    {
        Player AddPlayerProfile(string name, string username, string password);
        Player AuthenticatePlayer(string username, string password);
        IList<Player> GetPlayersList();

        GameRoom CreateGameRoom(int playerUserId);
        GameRoom JoinGameRoom(int playerUserId, int gameId,int playerMode);
        GameRoom UpdateGameRoomStatus(int gameId, int status);
        IList<GameRoom> GetGameRooms();
        IList<GameRoomClient> GetGameRoomSubscribers(long objGameRoomId);

        IList<GameMove> GetGameMovesSortedByTimeStamp(long objGameRoomId);
        IList<GameMove> GetLatestGameMoves(long objGameRoomId, DateTime timestamp);
        GameMove AddMove(int playerId, int gameId,string pieceId, 
            int finalPosition, DateTime? timestamp, 
            string listOfRemovedPieces, bool isKing);

        GameRoom GetOccupiedStatusOfGameRoom(int gameId, int occupiedByPLayer);
        GameRoom UpdateOccupiedStatusOfGameRoom(int gameId, int occupiedByPLayer);

        IList<GameMove> CheckForWinnerStatus(int gameId);
        Winner AddWinnerToGame(int gameId, int playerId);

        Winner GetWinner(int gameId);
    }
}
